#include<assert.h>
#include<stdio.h>
#include<string.h>
#include<ctype.h>
int main(){
    int n=12345;
    char s[20];
    sprintf(s,"00%d",n);
    puts(s);
    int len=strlen(s),w=len/3;
    int head,middle,tail;
    char *p=s+len;
    p-=w;
    sscanf(p,"%d",&tail);
    *p=0;
    p-=w;
    sscanf(p,"%d",&middle);
    *p=0;
    p-=w;
    sscanf(p,"%d",&head);
    printf("head=%d middle=%d tail=%d\n",head,middle,tail);
    return 0;
}
